import { apiPost } from '../func/fetch'
import type { PageResult } from "../global"
import type { AirportStationFrom, AirportStationPageData, AirportStationPageParam } from './type'

const _api = import.meta.env.VITE_FACEID_URL
// <-- 目的地管理 -->
// 分页
export const airportStationPageApi = (params: AirportStationPageParam): Promise<PageResult<AirportStationPageData>> => {
  return apiPost(`${_api}/airportStation/page`, params)
}
// 删除
export const airportStationDeleteApi = (params: { id: string }): Promise<null> => {
  return apiPost(`${_api}/airportStation/delete`, params)
}
// 新增
export const airportStationSaveApi = (params: AirportStationFrom): Promise<null> => {
  return apiPost(`${_api}/airportStation/save`, params)
}
// 编辑
export const airportStationEditApi = (params: AirportStationFrom): Promise<null> => {
  return apiPost(`${_api}/airportStation/update`, params)
}
// 目的地列表
export const airportStationListApi = (params: { stationName: string, type: '1' | '2' }): Promise<AirportStationPageData[]> => {
  return apiPost(`${_api}/airportStation/list`, params)
}